﻿namespace SlamCms.Web.Sitemaps
{
	public class Menu
	{
		public Menu(SitemapHtmlHelper sitemap, SitemapNode startingNode, int currentDepth, int maxDepth, string templateName = null)
		{
			Sitemap = sitemap;
			StartingNode = startingNode;
			CurrentDepth = currentDepth;
			MaxDepth = maxDepth;
			TemplateName = templateName;
			MaxNodesPerLevel = int.MaxValue;
		}

		public SitemapHtmlHelper Sitemap { get; private set; }
		public int CurrentDepth { get; set; }
		public int MaxDepth { get; set; }
		public int MaxNodesPerLevel { get; set; }
		public SitemapNode StartingNode { get; set; }
		public string TemplateName { get; set; }

		public Menu CloneForNode(SitemapNode sitemapNode, int currentDepth)
		{
			var clone = (Menu)this.MemberwiseClone();
			clone.StartingNode = sitemapNode;
			clone.CurrentDepth = currentDepth;
			return clone;
		}
	}
}
